#pragma once

#include "dynamictreewidgetitembase.h"

class QLineEdit;
class QPushButton;

namespace PublicGui
{
	class DynamicColorWidget:public DynamicTreeWidgetItemBase
	{
		Q_OBJECT
	public:
		DynamicColorWidget();
		~DynamicColorWidget();
		virtual void setItemData(CoreBase::ActorBase* actorptr,const QString& tag);
		virtual QVariant getItemData();
		virtual void setLabelTextList(QStringList mtext);
	protected:
		virtual void initializationUi();
		virtual void emitValueChanged();
	private:
		QLineEdit*				_editR;
		QLineEdit*				_editG;
		QLineEdit*				_editB;
		QLineEdit*				_editA;
		QTreeWidgetItem*		_labelR;
		QTreeWidgetItem*		_labelG;
		QTreeWidgetItem*		_labelB;
		QTreeWidgetItem*		_labelA;
		QString					_oldValue;
		QPushButton*			_colorButton;
	private slots:
		void slotsColorButtonClick();
		void slotValueChanged(const QString&);
	protected slots:
		virtual void slotFocusChanged(QWidget*,QWidget*);
	};
}